<html>
<head><meta charset="utf-8"><title>Why does compiletest pass -Z unstable-options? · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Why.20does.20compiletest.20pass.20-Z.20unstable-options.3F.html">Why does compiletest pass -Z unstable-options?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="227672133"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Why%20does%20compiletest%20pass%20-Z%20unstable-options%3F/near/227672133" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Why.20does.20compiletest.20pass.20-Z.20unstable-options.3F.html#227672133">(Feb 24 2021 at 21:02)</a>:</h4>
<p>I'm trying to test that a feature isn't enabled unless -Z unstable-options is passed. I can't do that because compiletest unconditionally passes -Z unstable-options to the test. Does anyone know why it gets passed? In case it matters, this is a <code>rustdoc-ui</code> test.</p>



<a name="227672521"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Why%20does%20compiletest%20pass%20-Z%20unstable-options%3F/near/227672521" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Why.20does.20compiletest.20pass.20-Z.20unstable-options.3F.html#227672521">(Feb 24 2021 at 21:04)</a>:</h4>
<p>it's getting set by <code>target_rustcflags</code>:</p>
<div class="codehilite"><pre><span></span><code>[src/tools/compiletest/src/runtest.rs:2040] &amp;self.config.target_rustcflags = Some(
    &quot;-Cdebuginfo=0 -Zunstable-options  -Lnative=/home/joshua/rustc2/build/x86_64-unknown-linux-gnu/native/rust-test-helpers&quot;,
)
</code></pre></div>



<a name="227672612"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Why%20does%20compiletest%20pass%20-Z%20unstable-options%3F/near/227672612" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Why.20does.20compiletest.20pass.20-Z.20unstable-options.3F.html#227672612">(Feb 24 2021 at 21:05)</a>:</h4>
<p>oh that's passed by x.py itself</p>



<a name="227672739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Why%20does%20compiletest%20pass%20-Z%20unstable-options%3F/near/227672739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Why.20does.20compiletest.20pass.20-Z.20unstable-options.3F.html#227672739">(Feb 24 2021 at 21:06)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/a8486b64b0c87dabd045453b6c81500015d122d6/src/bootstrap/test.rs#L1134">https://github.com/rust-lang/rust/blob/a8486b64b0c87dabd045453b6c81500015d122d6/src/bootstrap/test.rs#L1134</a></p>



<a name="227673726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Why%20does%20compiletest%20pass%20-Z%20unstable-options%3F/near/227673726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Why.20does.20compiletest.20pass.20-Z.20unstable-options.3F.html#227673726">(Feb 24 2021 at 21:13)</a>:</h4>
<p>yay code archeology <span aria-label="tada" class="emoji emoji-1f389" role="img" title="tada">:tada:</span> </p>
<p>$ git log --pretty="%H %s" --follow -S 'Zunstable-options' src/bootstrap/test.rs<br>
<a href="https://github.com/rust-lang/rust/commit/a3ed2abed7bfb432168eb33492af71ebb16724d9">a3ed2abed7bfb432168eb33492af71ebb16724d9</a> Fix empty tests<br>
<a href="https://github.com/rust-lang/rust/commit/b2192ae157eab3b83d7cbc42d2e08925cbdfd8b6">b2192ae157eab3b83d7cbc42d2e08925cbdfd8b6</a> Add rustdoc-ui test suite<br>
<a href="https://github.com/rust-lang/rust/commit/8c2ec689c159e7f021d5913efb991aff875be967">8c2ec689c159e7f021d5913efb991aff875be967</a> Put miri const eval checking behind -Zmiri</p>



<a name="227673879"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Why%20does%20compiletest%20pass%20-Z%20unstable-options%3F/near/227673879" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Why.20does.20compiletest.20pass.20-Z.20unstable-options.3F.html#227673879">(Feb 24 2021 at 21:14)</a>:</h4>
<p>I'm going to try just removing it and see what happens</p>



<a name="227675450"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Why%20does%20compiletest%20pass%20-Z%20unstable-options%3F/near/227675450" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Why.20does.20compiletest.20pass.20-Z.20unstable-options.3F.html#227675450">(Feb 24 2021 at 21:25)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/pull/82497">https://github.com/rust-lang/rust/pull/82497</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>